package Reseau;

import java.io.IOException;
import java.net.Socket;

import javax.swing.JLabel;
import javax.swing.JTextArea;

public class FluxReception extends FluxdeString implements Runnable {

	Socket socket;
	JTextArea texte;
	public FluxReception(Socket socket,JTextArea texte){
		this.socket = socket;
		this.texte = texte;
		new Thread(this).start();
	}
	public void run() {
		while(true){
			try {
				String message = super.reception(socket);
				texte.setText(texte.getText()+"\n Lui : "+message);
			} catch (IOException e) {
				e.printStackTrace();
			}
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}


}
